<?php
/**
 * friend follower certificates element class
 *
 * @final
 * @author raphael seebacher <raphasee@ee.ethz.ch>
 * @version 0.01
 */
final class ff_certificates extends message_element_controller {
    public function get_tag() {
        return 'ff_certificates';
    }

    protected function process_element() {
        $uc = user_controller::get_instance();
        $ff_users = $uc->get_user()->get_ff();

        $ff_certificates = Array();
        foreach ($ff_users as $ff) {
            try {
                $ff_certificates[$ff->get_id()] = $ff->get_current_certificate()->get('certificate');
            }
            catch (model_exception $e) {

            }
        }

        return Array(
          'status' => 'ok',
          'certificates' => $ff_certificates,
        );
    }
}
?>